Skip to content

Added support to HTTPS URLs and for special characters in the username or password#6

Merged
ProtoThis merged 1 commit into
ProtoThis:masterfrom
tchellomello:add_https_support
Jul 2, 2018
Merged

Added support to HTTPS URLs and for special characters in the username or password#6
ProtoThis merged 1 commit into
ProtoThis:masterfrom
tchellomello:add_https_support

Conversation

@tchellomello
Copy link
Copy Markdown
Contributor

@tchellomello tchellomello commented Jul 2, 2018

This PR added support to HTTPS URLs and also support special characters in the user's password such as '#' or '!'

Here below an example of using HTTPS and encoding a password

In [1]: from SynologyDSM import SynologyDSM

In [2]: api5 = SynologyDSM('192.168.0.1', 5001, 'admin', 'secret#qq', debugmode=True, use_https=True)

In [3]: api5.storage.volumes
DEBUG: Creating New Session
DEBUG: Requesting URL: 'https://192.168.0.1:5001/webapi/auth.cgi?api=SYNO.API.Auth&version=2&method=login&account=admin&passwd=secret#%23qq&session=Core&format=cookie'
DEBUG: Request executed: 200
DEBUG: Succesfull returning data
DEBUG: {'data': {'sid': 'jCXsRpHIK9999999'}, 'success': True}
DEBUG: Authentication Succesfull, token: jCXsRpHIK9999999
DEBUG: Requesting URL: 'https://192.168.0.1:5001/webapi/entry.cgi?api=SYNO.Storage.CGI.Storage&version=1&method=load_info'
DEBUG: Appending access_token (SID: jCXsRpHIK9999999) to url
DEBUG: Request executed: 200
DEBUG: Succesfull returning data
DEBUG: {'data': {'disks': [{'adv_progress': '', 'adv_status': 'not_support',  [.... SNIP...]  'success': True}
Out[4]: ['volume_1']

See also:

@tchellomello
Copy link
Copy Markdown
Contributor Author

@StaticCube I've already created a PR home-assistant/core#15270 waiting for this fix. Please let me know your thoughts 👍

@ProtoThis
Copy link
Copy Markdown
Owner

Looks really cool will do a checkout and let you know,

@ProtoThis ProtoThis merged commit 4363ded into ProtoThis:master Jul 2, 2018
@tchellomello tchellomello deleted the add_https_support branch July 2, 2018 20:16
@tchellomello
Copy link
Copy Markdown
Contributor Author

Thanks @StaticCube !

Quentame pushed a commit to Quentame/python-synology that referenced this pull request Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants